Rather than sprinkling panic()s throughout the setup code hoist the
check up into common code.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
int __init iommu_setup(void)
{
int rc = -ENODEV;
+ bool_t force_intremap = force_iommu && iommu_intremap;
if ( iommu_dom0_strict )
iommu_passthrough = 0;
iommu_enabled = (rc == 0);
}
- if ( force_iommu && !iommu_enabled )
- panic("IOMMU setup failed, crash Xen for security purpose!\n");
+ if ( (force_iommu && !iommu_enabled) ||
+ (force_intremap && !iommu_intremap) )
+ panic("Couldn't enable %s and iommu=required/force\n",
+ !iommu_enabled ? "IOMMU" : "Interrupt Remapping");
if ( !iommu_enabled )
{
"ioapic_to_iommu: ioapic 0x%x (id: 0x%x) is NULL! "
"Will not try to enable Interrupt Remapping.\n",
apic, IO_APIC_ID(apic));
- if ( force_iommu )
- panic("intremap remapping failed to enable with iommu=required/force in grub\n");
break;
}
}
iommu = drhd->iommu;
if ( enable_intremap(iommu, 0) != 0 )
{
+ iommu_intremap = 0;
dprintk(XENLOG_WARNING VTDPREFIX,
"Interrupt Remapping not enabled\n");
- if ( force_iommu && platform_supports_intremap() )
- panic("intremap remapping failed to enable with iommu=required/force in grub\n");
break;
}
}